package com.ecity.panels {
	import com.ecity.events.PageEvent;
	import com.ecity.util.UIFactory;
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import org.papervision3d.events.InteractiveScene3DEvent;
	import org.papervision3d.materials.MovieMaterial;
	import org.papervision3d.objects.primitives.Plane;
	
	/**
	 * ...
	 * @author Yicheng.Zhang
	 */
	public class SinglePanel extends Plane {
		public var mainPlane:Plane;
		public var textPlane:Plane;
		private var _ob:Outerborder;
		public var index:int;
		
		
		public function SinglePanel(index:int=0) {
			super(null, 1, 1);
			this.index = index;
			_ob = new Outerborder();
			var Mm:MovieClip = UIFactory.getMovieClip("border");
			var mcM:MovieMaterial = new MovieMaterial(Mm, true);
			mcM.interactive = true;
			mainPlane = new Plane(mcM, 160, 160);
			mainPlane.name = "menu"+index;
			mainPlane.addEventListener(InteractiveScene3DEvent.OBJECT_CLICK, onMouseClick);
			this.addChild(mainPlane, "mainPlane");
			textPlane = new Plane(null, 130, 130);
		}
		private function onMouseClick(e:InteractiveScene3DEvent):void {
			trace("----------x-----------------",e.target.name);
			this.dispatchEvent(new PageEvent(PageEvent.MENU_CLICK));
		}
		
	}

}